package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.article.util.TravelCondition;
import cn.wolfcode.luowowo.common.query.QueryObject;
import com.sun.javafx.image.IntPixelGetter;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject{

    private Long destId = -1L;

    private Integer dayType = -1;

    private Integer travelTimeType = -1;

    private Integer perExpendType = -1;

    private Integer orderType = 1;

    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }

    public TravelCondition getMonth(){
        return TravelCondition.TRAVEL_MONTHS.get(travelTimeType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.TRAVEL_PEREXPENDS.get(perExpendType);
    }

    public String getOrderBy(){
        return this.orderType == 2 ? "t.viewnum desc" : "t.createTime desc";
    }
}
